package com.jzo2o.customer.controller.worker;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author mwdr
 */
@RestController("workerBankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务端 - 服务人员端银行账户相关接口")
public class BankAccountController {

    @Resource
    private IBankAccountService bankAccountService;

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("查询当前登录用户银行账户信息")
    public BankAccountResDTO currentUserBankAccount(){
        return bankAccountService.currentUserBankAccount();
    }

    @PostMapping
    @ApiOperation("添加或修改服务人员银行账户信息")
    public void addOrUpdate(@RequestBody BankAccountUpsertReqDTO dto){
        bankAccountService.addOrUpdate(dto);
    }

}
